package com.lambda;

import java.lang.reflect.Field;

public class ReflectClass {

    private String readOnly;

    public String getReadOnly() {
        return readOnly;
    }

    public void setReadOnly(String readOnly) {
        System.out.println("set");
        this.readOnly = readOnly;
    }

    public static void main(String[] args) throws NoSuchFieldException, IllegalAccessException {
        ReflectClass t = new ReflectClass();
        Field f = t.getClass().getDeclaredField("readOnly");
        f.setAccessible(true);
        f.set(t, "test");
        System.out.println(t.getReadOnly());
    }
}
